package com.steven.ourcontest.information.api

import com.steven.ourcontest.information.bean.IdentifyStatusResponse
import com.steven.ourcontest.information.bean.ManageUsersDetailsRes
import com.steven.ourcontest.information.bean.SchoolList
import com.steven.ourcontest.information.bean.UserNameResponse
import com.steven.ourcontest.me.bean.UsersDetailsRes
import com.steven.ourcontest.net.BaseResponse
import com.steven.ourcontest.net.EmptyResponse
import io.reactivex.Observable
import okhttp3.RequestBody
import retrofit2.http.*


interface InfoApiService {

    @FormUrlEncoded
    @POST("/identify/schoolList")
    fun querySchoolList(@Field("schoolName") schoolName: String): Observable<BaseResponse<SchoolList>>

    @FormUrlEncoded
    @POST("/identify/addUserDetail")
    fun addUserDetail(
        @Field("uid") uid: Long,
        @Field("uname") uname: String,
        @Field("school") school: String,
        @Field("college") college: String,
        @Field("judge") judge: String,
        @Field("startYear") startYear: Long,
        @Field("schoolType") schoolType: String,
        @Field("userType") userType: String
    ): Observable<BaseResponse<EmptyResponse>>

    @FormUrlEncoded
    @POST("/identify/queryStatus")
    fun queryIdentifyStatus(@Field("uid") uid: Long): Observable<BaseResponse<IdentifyStatusResponse>>

    @POST("/identify/upload")
    fun uploadCard(
        @Body body: RequestBody
    ): Observable<BaseResponse<EmptyResponse>>

    @POST("/info/userName")
    fun queryUserDetail(): Observable<BaseResponse<UserNameResponse>>

    @POST("/identify/queryToBeConfirm")
    fun queryToBeConfirm(): Observable<BaseResponse<ManageUsersDetailsRes>>

    @FormUrlEncoded
    @POST("/identify/updateStatus")
    fun updateIdentifyStatus(
        @Field("normalUser") normalUser: Long,
        @Field("canPass") canPass: Boolean
    ): Observable<BaseResponse<EmptyResponse>>
}